﻿@model ProgressTracker.WebUI.Models.Shared.DayModel

<div id="dayTableAlert" class="alert" hidden="hidden"></div>

<div class="panel panel-default">
    <div class="panel-heading">Tasks for @Model.Day.ToShortDateString()</div>
    <div class="panel-body">@Html.TextAreaFor(x => x.Notes, new { @class="form-control", rows=4, placeholder="Notes" })</div>

    <table id="dayTable" class="table table-striped">
        <thead>
            <tr>
                <th>Task</th>
                <th>Description</th>
                <th>Complete?</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var task in Model.TasksForDay)
            {
                <tr>
                    <td hidden="hidden" class="taskId">@task.Id</td>
                    <td class="taskName">@task.Name</td>
                    <td class="taskDesc">@task.Description</td>
                    <td class="taskIsComplete">@Html.CheckBox("Complete", task.IsComplete)</td>
                </tr>
            }
        </tbody>
    </table>
</div>
<button id="updateDay" class="btn btn-primary">Update</button>

<div id="dayTableInfo" hidden="hidden" data-date=@Model.Day data-update-day-url="@Url.Action("Update", "Progress")"></div>
<script src="~/Scripts/Shared/DayTable.js"></script>